package global

import (
	"log"
	"github.com/go-redis/redis"
)
func OpenRedis() {
	redisCfg := Config.Redis
	RedisClient := redis.NewClient(&redis.Options{
		Addr: redisCfg.Addr,
		Password: redisCfg.Password,
		DB: redisCfg.DB,
	})
	pong,err := RedisClient.Ping().Result()
	if err != nil {
		log.Fatalln(err)
	}
	log.Println(pong,"redis success.")
}